package edu.zut.hb.ambition.service.impl;

import edu.zut.hb.ambition.base.service.impl.GenericTreeManagerImpl;
import edu.zut.hb.ambition.report.dao.ReportGroupDao;
import edu.zut.hb.ambition.report.domain.ReportGroup;
import edu.zut.hb.ambition.report.service.ReportGroupManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


import java.util.ArrayList;
import java.util.List;

@Service(value = ReportGroupManager")
@Transactional
public class ReportGroupManagerImpl extends GenericTreeManagerImpl<ReportGroup, Long>
        implements ReportGroupManager {

        ReportGroupDao ReportGroupDao;

    @Autowired
    public void setReportGroupDao(ReportGroupDao ReportGroupDao) {
        this.ReportGroupDao = ReporttGroupDao;
        this.treeDao = this.ReportGroupDao;
        this.dao = this.treeDao;
    }

    @Override
    public List list() {
        List list = new ArrayList();
        for (int i = 0; i < 100; i++) {
        ReportGroup c = new ReportGroup();
            c.setCode("Report_grou_"+i);
            c.setPrice(i);
            c.setEntityName("edu.zut.ai.mind");
            list.add(c);
        }
        return list;
    }

}